package spring;
import java.io.*; 

import org.springframework.beans.factory.*; 

import org.springframework.beans.factory.xml.*; 

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.*;
public class RmServiceClient {
	private RmService rmService;
	public void  setRmService(RmService rmServise)
	{
		this.rmService=rmServise;
	}
	 public static void main(String args[]) 
	   { 
	      try 
	      { 
	         System.out.println("Wait.."); 
//	         Resource  res = new ClassPathResource("client_config.xml"); 
//	         BeanFactory  factory = new  XmlBeanFactory(res); 
//	         System.out.println("factory created"); 
//	         RmService bean1 = (RmService)factory.getBean("Client"); 
//	         String s = bean1.getresult(args[0]); 
//	         System.out.println(s);
	         
	         ApplicationContext context = new
	         	ClassPathXmlApplicationContext("client_config.xml"); 
	 
	         RmServiceClient easyClient =
	          (RmServiceClient) context.getBean("Client");
	    	  String res=easyClient.rmService.getresult("ss");
	    	  System.out.println(res);
	         
	    	  
	      } 

	        catch(Exception e1) 
	               {System.out.println(""+e1);} 
	   }
	 
	 
}
